The present disclosure relates to image processing apparatuses, image processing methods, and programs, and particularly relates to an image processing apparatus, an image processing method, and a program which enable to generate a distance image in accordance with a shape of a closed curve input so as to enclose an object and calculate energy to thereby improve performance of a function of assigning features used to distinguish pixels which belong to the object from pixels which do not belong to the object.
In a field of image processing, a segmentation process of separating an image into an object (foreground) and a background has been considered as one of important functions, and various researches have been performed.
This segmentation process realizes a process of selecting a portion of an image to be subjected to a specific process and a process of extracting a portion of an image as an object to be synthesized with another image.
Examples of the effective segmentation process in which one of two attributes (labels), i.e., an object and a background, is assigned to each pixel of an image include a grabcut method (refer to “GrabCut: interactive foreground extraction using iterated graphcuts” Carsten Rother, Vladimir Kolmogorov, Andrew Blake ACM Transactions on Graphics, 23(3), August 2004, pp. 309-314 and U.S. Pat. No. 7,660,463)
In this method, first, a user specifies a rectangular line or a closed curve which surrounds an object to be extracted. As an algorithm, in an initial state, an outside of the rectangular line is determined to include pixels of a background and an inside is determined to include a mixture of pixels of an object and pixels of the background.
The segmentation process is repeatedly performed using two information items including likelihoods of individual pixels and continuities obtained by color differences among the pixels with reference to a color distribution model of the object and a color distribution model of the background while the color distribution models are updated so that pixels representing the object are determined.
The likelihoods of the individual pixels and the color differences among the pixels are obtained as graph data representing an energy which is to be subjected to energy minimization calculation so that a pixel aggregate of the object is obtained.
The energy used for the minimization calculation corresponds to the likelihoods of the individual pixels and the color differences among pixels, and the input closed curve is only used for attribute categorization for the pixels in which the pixels are categorized into the foreground and the background in the initial state.
Since the closed curve is input so as to surround an outer circumference of the object, it is highly likely that the closed curve is similar to a final shape of the object, and therefore, the closed curve is important information to be positively utilized.
As a simple method for addressing this matter, a method for shrinking the input closed curve inward by a predetermined width such that a boundary between the object and the background is included in a band region defined by the input closed curve and the shrunk closed curve has been considered.
In general, an operation performed for the shrinkage by a desired width is referred to as “Erosion”, and a method for performing segmentation using this method has been proposed (refer to U.S. Pat. No. 7,400,767).